﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UC_USER_UC_LoginUser : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ten"] != null)
        {
            Response.Redirect("Default.aspx");
        }
    }
    protected void btdangnhap_Click(object sender, ImageClickEventArgs e)
    {
        DangNhapBLL DNL = new DangNhapBLL();
        int kt = DNL.CheckDangNhap(txtTaiKhoan.Text.Trim(), txtMatKhau.Text.Trim());
        if (kt == 1 || kt == 2)
        {
            Session["DangNhap"] = true;
            Session["ten"] = txtTaiKhoan.Text;
            Response.Redirect("Default.aspx");
        }
        else
        {
            lblThongBao.Visible = true;
            lblThongBao.Text = "Thông tin không đúng !";
        }
    }
}